Optimal. Leaf size=51 \[ -\frac{(a+2 b) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.052528, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3664, 455, 388, 207} \[ -\frac{(a+2 b) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3664
Rule 455
Rule 388
Rule 207
Rubi steps
\begin{align*} \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (a-b+b x^2\right )}{\left (-1+x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}-\frac{\operatorname{Subst}\left (\int \frac{-a-2 b x^2}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 f}\\ &=-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f}+\frac{(a+2 b) \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 f}\\ &=-\frac{(a+2 b) \tanh ^{-1}(\cos (e+f x))}{2 f}-\frac{a \cot (e+f x) \csc (e+f x)}{2 f}+\frac{b \sec (e+f x)}{f}\\ \end{align*}
Mathematica [B] time = 0.0448324, size = 123, normalized size = 2.41 \[ -\frac{a \csc ^2\left (\frac{1}{2} (e+f x)\right )}{8 f}+\frac{a \sec ^2\left (\frac{1}{2} (e+f x)\right )}{8 f}+\frac{a \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )}{2 f}-\frac{a \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{2 f}+\frac{b \sec (e+f x)}{f}+\frac{b \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )}{f}-\frac{b \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.08, size = 76, normalized size = 1.5 \begin{align*}{\frac{b}{f\cos \left ( fx+e \right ) }}+{\frac{b\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}}-{\frac{\cot \left ( fx+e \right ) a\csc \left ( fx+e \right ) }{2\,f}}+{\frac{a\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{2\,f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.03911, size = 103, normalized size = 2.02 \begin{align*} -\frac{{\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) -{\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac{2 \,{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - 2 \, b\right )}}{\cos \left (f x + e\right )^{3} - \cos \left (f x + e\right )}}{4 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.96736, size = 325, normalized size = 6.37 \begin{align*} \frac{2 \,{\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} -{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} -{\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) +{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} -{\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 4 \, b}{4 \,{\left (f \cos \left (f x + e\right )^{3} - f \cos \left (f x + e\right )\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{3}{\left (e + f x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.45158, size = 246, normalized size = 4.82 \begin{align*} \frac{2 \,{\left (a + 2 \, b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) - \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a + \frac{14 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + \frac{{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]